from selenium import webdriver
import time

# 打开浏览器，请求目标网址
driver = webdriver.Chrome()
driver.get('https://mail.163.com/')

# 添加登录需要的cookie
cookies = [
    {
        'name': 'NTES_SESS',
        'value': 'Qw7y39zoJVEEtM5rWGeN82H8U2wgO_b7gtqBs1XI7oz_a7s5atXR4y.576VcSWmdWic5Oe9fcQvb4INCMUQ8z57TywU4b447oog7uMPcQIeBhWZkz9N.9uVqcBtmuoy3G.vSFkHS2.36l0.gSnJV.z3I5xmpzMVGBmdjHFnGKNOxZJz_v2j9kkIDlOYro148dQM0rmxox53GKizfDF4PKIkZh'
    },
    {
        'name': 'MAIL_ENTRY_INFO',
        'value': '1|0|mail163|email163|221.234.129.46|d3c7cfc5e9025a6b299737db562996ad_v1|'
    },
    {
        'name': 'MAIL_ENTRY_CS',
        'value':'6735709c40495f34a4f8fcf52e02dcf6'
    },
    {
        'name': 'Coremail',
        'value':'270fa567af3cf%bDdaZHbZJaFbITgKUQZZubQuRbSpkCHi%g1a153.mail.163.com'
    },
    {
        'name': 'cm_last_info',
        'value':'dT1oangxOTc1NTAxMjgyJTQwMTYzLmNvbSZkPWh0dHBzJTNBJTJGJTJGbWFpbC4xNjMuY29tJTJGanM2JTJGbWFpbi5qc3AlM0ZzaWQlM0RiRGRhWkhiWkphRmJJVGdLVVFaWnViUXVSYlNwa0NIaSZzPWJEZGFaSGJaSmFGYklUZ0tVUVpadWJRdVJiU3BrQ0hpJmg9aHR0cHMlM0ElMkYlMkZtYWlsLjE2My5jb20lMkZqczYlMkZtYWluLmpzcCUzRnNpZCUzRGJEZGFaSGJaSmFGYklUZ0tVUVpadWJRdVJiU3BrQ0hpJnc9aHR0cHMlM0ElMkYlMkZtYWlsLjE2My5jb20mbD0tMSZ0PTcmYXM9dHJ1ZQ=='
    }
]

# 添加cookie
driver.add_cookie(cookies[0])
driver.add_cookie(cookies[1])
driver.add_cookie(cookies[2])
driver.add_cookie(cookies[3])
driver.add_cookie(cookies[4])

# 刷新浏览器
driver.refresh()

# 退出浏览器
time.sleep(5)
driver.quit()

